# 把train  pred1  pred2 压缩保存
# 然后直接移动图片到最终的train_data文件夹中

import os
import shutil

path = 'E:/brand-form_pred2'  # 依次改成 train  pred1 pred2 的文件夹
target_path= 'E:/train_data'

dirs = os.listdir(path)
for num,dir in enumerate(dirs):
    if num % 100 == 0:
        print(num)
    dir_path = os.path.join(path,dir)
    target_dir_path = os.path.join(target_path,dir)

    files = os.listdir(dir_path)

    for file in files:
        file_path = os.path.join(dir_path,file)
        target_file_path = os.path.join(target_dir_path,file)
        shutil.move(file_path,target_file_path)
        

